<?php
echo $this->loadJs();
echo $this->loadCss();
echo $this->headScript()->appendFile($this->baseUrl() . "/js/admin/rol/rol.js");
$this->subtitulo = "Roles";
echo $this->rolid;
?>
<script src="/js/bootstrap/bootbox.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function() {
        loadPermissions();
        $('#permissions').click(function() {
            $("#permiso-form-content").dialog("open");
        });
//        $('#savebtn').click(function(){
//                guardar();
//        });
        $('#cancelbtn').click(function() {
            cancelar();
        });
        menuClass("rol");
    });

    $(document).on("click", "#savebtn", function(e) {
        bootbox.confirm('<?php echo $this->saveConfirmMessage; ?>', function(result) {
            if (result) {
                guardar();
            }
        });
    });
</script>
<div id="main-lab-container">
    <div id="general-data">  
        <div id="general-data-container" class="data-container">
            <div class="control-group">
                <label class="control-label" for="codigo-rol">Nombre</label>
                <div class="controls">
                    <input type="text" id="nombre-rol" name="nombre-rol" class="input-block-level" placeholder="Nombre" value="<?php echo $this->nombre; ?>"/>
                    <button id="permissions" class="btn btn-small btn-primary">Permisos</button>
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <button id="savebtn" class="btn btn-small btn-primary">Guardar</button>
                    <button id="cancelbtn" class="btn btn-small btn-primary">Cancelar</button>
                    <input type="hidden" id="codigo-rol" name="codigo-rol" value="<?php echo $this->codigoRol; ?>">
                </div>
            </div>
            <div id="permiso-form-content" style="display:none" title="Permisos"></div>
        </div>
    </div>
</div>

